<template>
  <component :is="componentName"></component>
</template>

<script>
/*eslint-disable*/
import { getCurrentInstance, onMounted } from "vue";
import pubsub from "pubsub-js";
import { ElMessage } from "element-plus";

import banner from "@/components/banner.vue";
import modMenu from "@/components/modMenu.vue";
import pathApi from "@/api/pathApi.js";

export default {
  name: "主页容器",
  components: {
    banner,
    modMenu,
  },
  data() {
    return {
      componentName: "banner",
    };
  },
  setup() {
    const { proxy } = getCurrentInstance();

    onMounted(() => {
      // 首页横幅跳转至mod菜单
      pubsub.subscribe("bannerToModmenu", (n, data) => {
        proxy.componentName = "modMenu";
      });
      // 路径验证
      pathApi.PathValidation();
    });
  },
};
</script>

<style lang="less" scoped>
</style>